package com.zy.chapter5

/**
 * @author: zhaoyi
 * @create: 2020-06-07 22:58
 * @description: ${description}
 **/
class MySimpleClass {

  private var name: String = _

  def printName() = {
    println(name)
  }

  def this(name: String) {
    this()
    this.name = name
  }

  def this(name: String,age:Int) {
    this(name)
    this.name = name
  }

  println(s"主构造器执行类体类所以语句 $name")

}
